<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Vue示例</title>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="(book,index) in books">{{index}} - {{book.name}}</li>
    </ul>
</div>
<script src="../../vue.js"></script>
<!--<script src="https://unpkg.com/vue/dist/vue.min.js"></script>-->
<script>
    var app = new Vue({
        el: "#app",
        data: {
            books: [
                {name: '《Vue.js 实践》'},
                {name: '《JavaScript 语言精粹》'},
                {name: '《JavaScript 高级程序设计》'}
            ]
        }
    });
    // 添加一项数据
    app.books.push({
        name: '《CSS揭秘》',
        author: '[希] Lea Verou'
    });
</script>
</body>
</html>